//
//  MainSecondCollectionViewCell.m
//  Beauty
//
//  Created by Snow on 16/9/3.
//  Copyright © 2016年 Snow. All rights reserved.
//

#import "MainSecondCollectionViewCell.h"
#import "GXMacro.h"
@implementation MainSecondCollectionViewCell
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.contentView.backgroundColor = [UIColor colorWithWhite:0.667 alpha:0.488];
        self.contentView.layer.masksToBounds = YES;
        self.contentView.layer.cornerRadius = 5;
        _image = [[UIImageView alloc] init];
        [self.contentView addSubview:_image];
        _labelOfName = [[UILabel alloc] init];
        [self.contentView addSubview:_labelOfName];
        _labelOfFans = [[UILabel alloc] init];
        [self.contentView addSubview:_labelOfFans];
        _labelOfName.font = [UIFont systemFontOfSize:14];
        _labelOfFans.font = [UIFont systemFontOfSize:14];
        _buttonOfConstract = [UIButton buttonWithType:UIButtonTypeSystem];
        [self.contentView addSubview:_buttonOfConstract];
        _buttonOfConstract.layer.masksToBounds = YES;
        _buttonOfConstract.layer.cornerRadius = 5;
        _buttonOfConstract.layer.borderWidth = 1;
        _buttonOfConstract.layer.borderColor = [[UIColor colorWithRed:0.949 green:0.518 blue:0.651 alpha:1.000] CGColor];
        [_buttonOfConstract setTitle:@"+关注" forState:UIControlStateNormal];
        _buttonOfConstract.titleLabel.font = [UIFont systemFontOfSize:15];
        _buttonOfConstract.tintColor = [UIColor colorWithRed:0.949 green:0.518 blue:0.651 alpha:1.000];
    }
    return self;
}
- (void)layoutSubviews
{
    [super layoutSubviews];
    [_image mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(self.contentView.mas_centerY);
        make.left.mas_equalTo(self.contentView.mas_left).mas_equalTo(20);
        make.width.mas_equalTo(60);
        make.height.mas_equalTo(60);
    }];
    [_labelOfName mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(_image.mas_right).mas_equalTo(10);
        make.right.mas_equalTo(self.contentView.mas_right).mas_equalTo(-10);
        make.top.mas_equalTo(self.contentView.mas_top).mas_equalTo(10);
        make.height.mas_equalTo(20);
    }];
    [_labelOfFans mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(_image.mas_right).mas_equalTo(10);
        make.top.mas_equalTo(_labelOfName.mas_bottom);
        make.height.mas_equalTo(20);
        make.right.mas_equalTo(self.contentView.mas_right).mas_equalTo(-10);
    }];
    [_buttonOfConstract mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(_image.mas_right).mas_equalTo(10);
        make.top.mas_equalTo(_labelOfFans.mas_bottom);
        make.width.mas_equalTo(50);
        make.height.mas_equalTo(20);
    }];
}
@end
